package com.jacobson.huobi.mvp.adapters

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.jacobson.huobi.mvp.fragment.MeFragment
import com.jacobson.huobi.mvp.fragment.SymbolFragment
import com.jacobson.huobi.utils.Weak

class MainAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {

    private var fragments :MutableList<Fragment> =  mutableListOf()
    init {
        fragments.add(SymbolFragment.newInstance(SymbolFragment.HUOBI))
        fragments.add(SymbolFragment.newInstance(SymbolFragment.OKEX))
        fragments.add(SymbolFragment.newInstance(SymbolFragment.BIAN))
        fragments.add(SymbolFragment.newInstance(SymbolFragment.COIN_58))
        fragments.add( MeFragment.newInstance() )
    }


    override fun getCount(): Int {
        return fragments.size
    }

    override fun getItem(position: Int): Fragment {

        return fragments[position]
    }
}